//
//  CouponsTypeTableViewCell.m
//  AnXin100
//
//  Created by Sakura on 2018/11/6.
//  Copyright © 2018 tzhg. All rights reserved.
//

#import "CouponsTypeTableViewCell.h"

@interface CouponsTypeTableViewCell ()
@property (weak, nonatomic) IBOutlet UIView *layerView;
@property (weak, nonatomic) IBOutlet UIButton *typeBtn;

@end

@implementation CouponsTypeTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    _layerView.layer.borderWidth = 1;
    _layerView.layer.borderColor = [UIColor colorWithHex:0x29B566].CGColor;
    _layerView.layer.masksToBounds = YES;
}

- (void)setType:(UseType)type {
    if (type == BeenUsed) {
        _typeBtn.backgroundColor = [UIColor colorWithHex:0xE6E6E6];
        [_typeBtn setTitle:@"已使用" forState:UIControlStateNormal];
    } else if (type == Expired) {
        _typeBtn.backgroundColor = [UIColor colorWithHex:0xE6E6E6];
        [_typeBtn setTitle:@"已过期" forState:UIControlStateNormal];

    } else {
        _typeBtn.backgroundColor = COLOR_ORG;
        [_typeBtn setTitle:@"待使用" forState:UIControlStateNormal];
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

}

@end
